<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="dictGroupList" checkbox="true" fitColumns="true" title="耗材购置复审" actionUrl="consumeMeterialBuyApplyController.do?reAuditDatagrid" idField="id" fit="true" queryMode="group">
   <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="申请状态"  field="applyState_value" hidden="true"    queryMode="single"  width="100"></t:dgCol>
   <t:dgCol title="申请日期"  field="createDate"  query="true"  formatter="yyyy-MM-dd"   queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="申请人"  query="true" field="applyUser_realName"    queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="总金额"  field="totalAmount"   queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="申请状态"  field="applyState_name"    queryMode="single"  width="100"></t:dgCol>
   <t:dgCol title="操作" field="opt" width="100"></t:dgCol>
    <t:dgFunOpt  funname="showItemDetail({'查看'},{'consumeMeterialBuyApplyController.do?goDetail'},id,{'460'},{'280'})" title="查看"  />
    <t:dgFunOpt funname="submitApply(id)" title="通过"  ></t:dgFunOpt>
   <t:dgFunOpt funname="auditFial(id)" title="不通过"  ></t:dgFunOpt> 
  
   </t:datagrid>
  </div>
 </div>
  <script type="text/javascript">
 $(document).ready(function(){
 	//给时间控件加上样式
 	$("#dictGroupListtb").find("input[name='createDate']").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 });
 
 function auditFial(id){
	 var url='commonInputController.do?show&postURL=consumeMeterialBuyApplyController.do?doReAudit&id='+id+"&result=1";
	 $.dialog({
		  	id:'commonInputController',
			content: 'url:'+url,
			lock : true,
			zIndex: getzIndex(), 
			width:510,
			height:230,
			title:'输入审核意见', 
			opacity : 0.3,
			cache:false,
		    cancelVal: '关闭',
		    cancel: true,
		    parent:parent,
		    ok: function(){
		    	iframe = this.iframe.contentWindow;
		    	$('#btn_sub', iframe.document).click();
		    	return false;
		    },
		}); 
 }
 
 
 function submitApply(id){
	 
	 var url='commonInputController.do?show&postURL=consumeMeterialBuyApplyController.do?doReAudit&id='+id+"&result=0";
	 $.dialog({
		  	id:'commonInputController',
			content: 'url:'+url,
			lock : true,
			zIndex: getzIndex(), 
			width:510,
			height:230,
			title:'输入审核意见', 
			opacity : 0.3,
			cache:false,
		    cancelVal: '关闭',
		    cancel: true,
		    parent:parent,
		    ok: function(){
		    	iframe = this.iframe.contentWindow;
		    	$('#btn_sub', iframe.document).click();
		    	return false;
		    },
		}); 
	 
		
	}
 
 </script>